<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
        }

        li {
            list-style: none;
        }

        a {
            text-decoration: none;
        }

        div {
            width: 600px;
            height: 100px;
            margin: 100px auto;
            /* border: 1px solid red; */
        }

        .u1 {
            background-color: red;
            border-radius: 10px 10px 0 0;
        }

        .u2 {
            background-color: #FCF0EF;
        }

        .u1,
        .u2 {
            height: 50px;
            display: flex;
        }

        li {
            width: 100px;
            height: 50px;
            text-align: center;
            line-height: 50px;
            color: #fff;
            font-weight: 600;
            border-right: 2px solid #fff;
        }

        input {
            width: 85px;
            height: 50px;
            border: none;
            outline: none;
            background-color: transparent;
            text-align: center;
        }
        .shou,
        .head{
            width: 150px;
        }
        .shou input,
        .head input{
            width: 140px;
        }
    </style>
</head>

<body>
    <div>
        <ul class="u1">
            <li class="head">商品名称</li>
            <li>商品价格</li>
            <li>商品数量</li>
            <li>总价</li>
            <li class="shou">收货地址</li>
        </ul>
        <ul class="u2">
            <li class="head"><input type="text"></li>
            <li class="jiage"><input type="text"></li>
            <li class="shuliang"><input type="text"></li>
            <li class="zongjia"><input type="text"></li>
            <li class="shou"><input type="text"></li>
        </ul>
    </div>
</body>

</html>
<script>
    var jg = document.querySelector('.jiage input');
    var sl = document.querySelector('.shuliang input');
    var zj = document.querySelector('.zongjia input');

    jg.addEventListener('input', function () {
        var a = parseFloat(sl.value) || 0;
        var b = parseFloat(jg.value) || 0;
        zj.value = (a * b).toFixed(2);
        
    })
    sl.addEventListener('input', function () {
        var a = parseFloat(sl.value) || 0;
        var b = parseFloat(jg.value) || 0;
        zj.value = (a * b).toFixed(2);
        
    })
</script>